package com.ss.android.wenda.answer.detail2;

import android.view.View;
import android.widget.TextView;
import com.ss.android.article.base.app.AppData;

public final class WDFontUtils {
    public enum FontViewType {
        QUESTION_TITLE,
        QUESTION_CONTENT,
        ANSWER_NUM,
        ANSWER_CONTENT
    }


    public static int[] a;
    public static int[] b;
    public static int[] c;
    public static int[] d;
    private static int[] e;

    static {
        WDFontUtils.a = new int[]{19, 17, 21, 24};
        WDFontUtils.b = new int[]{12, 10, 14, 17};
        WDFontUtils.c = new int[]{16, 14, 18, 21};
        WDFontUtils.e = new int[]{15, 13, 17, 20};
        WDFontUtils.d = new int[]{17, 15, 19, 22};
        int[] v0 = new int[]{14, 12, 16, 19};
    }

    public static void a(View arg3, FontViewType arg4) {
        int[] v1;
        if((arg3 instanceof TextView)) {
            int[] v0 = null;
            switch(ar.a[arg4.ordinal()]) {
                case 1: {
                    v1 = WDFontUtils.a;
                    break;
                }
                case 2: {
                    v1 = WDFontUtils.c;
                    break;
                }
                case 3: {
                    v1 = WDFontUtils.e;
                    break;
                }
                case 4: {
                    v1 = WDFontUtils.d;
                    break;
                }
                default: {
                    v1 = v0;
                    break;
                }
            }

            if(v1 != null && v1.length != 0) {
                int v0_1 = AppData.getInstance().mFontSizePref;
                if(v0_1 >= v1.length || v0_1 < 0) {
                    v0_1 = 0;
                }

                if(v1[v0_1] <= 0) {
                    return;
                }

                ((TextView)arg3).setTextSize(((float)v1[v0_1]));
            }
        }
    }
}

